import { CountsList } from "../../http/apis/goodsApi/commodity"

export default {
  // 查询列表总条数
  GetCounts(context, type) {
    return new Promise((resolve, reject) => {
      CountsList(type).then(res => {
        if (res.data.code === 200) {
          context.commit('GoodsGetCount', res.data.count)
          resolve(res)
        } else {
          reject({
            code: res.data.code,
            msg: res.data.msg
          })
        }
      })
    })
  },
}